{include file="public/header" /}

<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">时间范围</label>
                            <div class="layui-input-inline">
                                <input type="text" name="time" class="layui-input" id="test6" placeholder=" - ">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">渠道名称</label>
                    <div class="layui-input-block">
                        <select name="adminID">
                            <option value="">全部</option>
                            {volist name="data" id="vo"}
                            <option value="{$vo.ID}">{$vo.Name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-user-back-search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </div>

        <!--<div class="layui-card-body">-->
        <!--<div style="padding-bottom: 10px;">-->
        <!--<button class="layui-btn layuiadmin-btn-list" data-type="batchdel">删除</button>-->
        <!--<button class="layui-btn layuiadmin-btn-list" data-type="add">添加</button>-->
        <!--</div>-->
        <!--</div>-->
    </div>

    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <!--<div class="layui-card-header">催收分析</div>-->
                <div class="layui-card-body">
                    <table class="layui-hide" id="test-table-checkbox" lay-filter="test-table-checkbox"></table>

                    <script type="text/html" id="table-content-list">
                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="sameDay" lay-tips="当日用户所属渠道数据"><i class="layui-icon layui-icon-search"></i>当天</a>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
</body>

{include file="public/footer" /}

<script>
    layui.use(['table','form','laydate'], function(){
        var table = layui.table;
        var form = layui.form;
        var laydate = layui.laydate;

        //日期主题
        laydate.render({
            elem: '#test6'
            ,range: true
            ,theme: 'molv'
        });

        //监听搜索
        form.on('submit(LAY-user-back-search)', function(data){
            var field = data.field;
            //执行重载
            table.reload('test-table-checkbox', {
                where:{
                    'name':field.name,
                    'time':field.time,
                    'adminID':field.adminID,
                }
            });
        });

        //定义表格基础参数
        table.render({
            elem: '#test-table-checkbox',
            url: "{:url('admin/sum/channelSum')}",
            toolbar:true,
            defaultToolbar: ['filter', 'exports', 'print'],
            height: 'full-200',//最大高度
            cols: [[//标题栏
                {field: 'time', title: "<p style='text-align:center;'>日期</p>", width: 110,rowspan: 2,fixed: 'left'} //rowspan即纵向跨越的单元格数
                ,{field: 'zcNum', title: "<p style='text-align:center' lay-tips='当日注册用户数'>注册人数?</p>",}

                ,{field: 'sfNum', title: "<p style='text-align:center' lay-tips='当日注册用户数中身份认证数'>身份认证?</p>",}
                ,{field: 'sjNum', title: "<p style='text-align:center' lay-tips='当日注册用户数中手机认证数'>手机认证?</p>",}
                ,{field: 'sjNums', title: "<p style='text-align:center' lay-tips='当日注册用户数中社交认证数'>社交认证?</p>",}
                ,{field: 'yhNum', title: "<p style='text-align:center' lay-tips='当日注册用户数中银行卡认证数'>银行卡认证?</p>",}

                ,{field: 'sqNum', title: "<p style='text-align:center' lay-tips='当日注册用户数中申请人数【用户第一笔申请订单】'>申请人数?</p>",}
                ,{field: 'sqLv', title: "<p style='text-align:center' lay-tips='申请率 = (申请人数/注册人数)*100%'>申请率?</p>",}

                ,{field: 'sq0FenNum', title: "<p style='text-align:center' lay-tips='当日申请订单中风控分为0的'>0分申请数?</p>",}
                ,{field: 'sq0FenLv', title: "<p style='text-align:center' lay-tips='（0分申请数/申请人数）*100%'>0分率?</p>",}

                ,{field: 'fkNum', title: "<p style='text-align:center' lay-tips='当日注册用户数中放款人数【用户第一笔放款订单】'>放款人数?</p>",}
                ,{field: 'fkLv', title: "<p style='text-align:center' lay-tips='放款率 = (放款人数/注册人数)*100%'>放款率?</p>",}

                ,{fixed: 'right',title:'操作', align:'center', toolbar: '#table-content-list'}
            ]],
            page: true
        });

        //监听工具栏
        table.on('tool(test-table-checkbox)', function(obj){
            if(obj.event === 'sameDay'){
                if(obj.data.time){
                    layer.open({
                        type: 2
                        ,title: ''
                        ,content: 'sameDay?ids='+obj.data.ids+'&time='+obj.data.time
                        ,maxmin: true
                        ,area:['90%','80%']
                        ,shadeClose:true
                        ,where:{"sss":"333"}
                    });
                }else{
                    layer.msg('未查到订单信息',{time:600});
                }
            }
        });
    });
</script>